#include "GameCC.h"

void GameControlCenter::categoriesScreenView(void)
{
	CatCC.print(false);
}

void GameControlCenter::gameBoardView(void)
{
	BoardCC.run();	
}

void GameControlCenter::helpScreenView(void)
{
   PrintFile("help.txt");
}

void GameControlCenter::init(void)
{
	srand((unsigned)time(NULL));
	PlayersCC.load();
	CatCC.load();
}

char GameControlCenter::mainMenuView(void)
{
   ClearScreen();

   printf("(N)ew Game\n");
   printf("(S)cores\n");
   printf("(C)ategories\n");
   printf("(H)elp\n");
   printf("(R)ules\n");
   printf("(Q)uit\n");

   return WaitForKey("");
}

void GameControlCenter::rulesScreenView(void)
{
   PrintFile("rules.txt");
}

void GameControlCenter::scoresScreenView(void)
{
   PlayersCC.printScores();
}

void GameControlCenter::start(void)
{
   welcomeScreenView();
   while(1)
   {
      char ch = mainMenuView();
      switch(ch)
      {
         case 'c': case 'C': categoriesScreenView(); break;
         case 'n': case 'N': gameBoardView(); break;
         case 'r': case 'R': rulesScreenView(); break;
         case 'h': case 'H': helpScreenView(); break;
         case 's': case 'S': scoresScreenView(); break;
         case 'q': case 'Q': return;
      }
   }
}

void GameControlCenter::welcomeScreenView(void)
{
   PrintFile("welcome.txt");
}
